package com.lsu.app.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lsu.app.bean.KvCode;
import com.lsu.app.service.KvCodeService;
import com.lsu.app.mapper.KvCodeMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 *
 * @description 针对表【kv_code(存储键值对的表)】的数据库操作Service实现
 * @Date 2023-11-19 13:41:19
 * @author hjj
 */
@Service
public class KvCodeServiceImpl extends ServiceImpl<KvCodeMapper, KvCode> implements KvCodeService{
    private final KvCodeMapper mapper;

    public KvCodeServiceImpl(KvCodeMapper mapper) {
        this.mapper = mapper;
    }

    @Override
    public List<KvCode> getOneKinds() {
        return mapper.getOneKinds();
    }

    @Override
    public List<String> getTwoKindsName(Integer value) {
        return mapper.getTwoKindsName(value);
    }

    @Override
    public Boolean isOneKind(String name) {
        return mapper.isOneKind(name)!=0;
    }

    @Override
    public List<String> getKindNamesByName(String name) {
        return mapper.getTwoKindsName(mapper.getIdBySearch(name));
    }
}




